/*     */ package com.lmpop.trade.tb_goodstate;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import com.lmpop.frame.util.RandomID;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ import java.util.Map;
/*     */ 
/*     */ public class Tb_goodstateInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Tb_goodstateInfo()
/*     */   {
/*  17 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  27 */     String pk_state = map.getString("pk_state");
/*     */ 
/*  30 */     Tb_goodstate tb_goodstate = new Tb_goodstate();
/*  31 */     tb_goodstate.setState_name(map.getString("state_name"));
/*  32 */     tb_goodstate.setUser_id(map.getString("session_user_id"));
/*     */ 
/*  40 */     String result_code = "0";
/*     */     try
/*     */     {
/*  43 */       if (!pk_state.equals(""))
/*     */       {
/*  45 */         String[] pkStr = pk_state.split(",");
/*  46 */         for (int i = 0; i < pkStr.length; i++)
/*     */         {
/*  48 */           if (pkStr[i].equals(""))
/*     */             continue;
/*  50 */           String state_id = new RandomID().GenTradeId();
/*  51 */           tb_goodstate.setState_id(state_id);
/*  52 */           String[] p_s = pkStr[i].split("\\|");
/*  53 */           tb_goodstate.setGoods_id(p_s[0]);
/*  54 */           tb_goodstate.setState_code(p_s[1]);
/*  55 */           insert(dbmMgr, tb_goodstate);
/*     */         }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e)
/*     */     {
/*  61 */       e.printStackTrace();
/*  62 */       result_code = "1";
/*     */     }
/*  64 */     map.setString("result_code", result_code);
/*  65 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Tb_goodstate tb_goodstate)
/*     */     throws ApplicationException
/*     */   {
/*  74 */     dbmMgr.update("insertTb_goodstate", tb_goodstate);
/*     */   }
/*     */ 
/*     */   public SysMap insertAfterUpdate(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  86 */     String state_code = map.getString("state_code");
/*  87 */     String goods_id = map.getString("goods_id");
/*  88 */     Tb_goodstate tb_goodstate = new Tb_goodstate();
/*  89 */     tb_goodstate.setState_name(map.getString("state_name"));
/*  90 */     tb_goodstate.setUser_id(map.getString("session_user_id"));
/*  91 */     String state_id = new RandomID().GenTradeId();
/*  92 */     tb_goodstate.setState_id(state_id);
/*  93 */     tb_goodstate.setGoods_id(goods_id);
/*  94 */     tb_goodstate.setState_code(state_code);
/*     */ 
/* 102 */     String result_code = "0";
/*     */     try {
/* 104 */       insertAfterUpdate(dbmMgr, tb_goodstate);
/*     */     } catch (ApplicationException e) {
/* 106 */       e.printStackTrace();
/* 107 */       result_code = "1";
/*     */     }
/* 109 */     map.setString("result_code", result_code);
/* 110 */     return map;
/*     */   }
/*     */ 
/*     */   public void insertAfterUpdate(DbmInterf dbmMgr, Tb_goodstate tb_goodstate)
/*     */     throws ApplicationException
/*     */   {
/* 119 */     dbmMgr.update("insertTb_goodstate", tb_goodstate);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 129 */     String pkid_string = map.getString("pkid");
/* 130 */     String result_code = "0";
/*     */     try {
/* 132 */       if (!pkid_string.equals("")) {
/* 133 */         String[] pkStr = pkid_string.split("\\|");
/* 134 */         for (int i = 0; i < pkStr.length; i++) {
/* 135 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/* 139 */       e.printStackTrace();
/* 140 */       result_code = "1";
/*     */     }
/* 142 */     map.setString("result_code", result_code);
/* 143 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 152 */     dbmMgr.update("deleteTb_goodstate", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap deleteByGoodsId(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 161 */     String pkid_string = map.getString("pkid");
/* 162 */     String result_code = "0";
/*     */     try {
/* 164 */       if (!pkid_string.equals("")) {
/* 165 */         String[] pkStr = pkid_string.split("\\|");
/* 166 */         for (int i = 0; i < pkStr.length; i++) {
/* 167 */           if (pkStr[i].equals("")) continue; deleteByGoodsId(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/* 171 */       e.printStackTrace();
/* 172 */       result_code = "1";
/*     */     }
/* 174 */     map.setString("result_code", result_code);
/* 175 */     return map;
/*     */   }
/*     */ 
/*     */   public void deleteByGoodsId(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/* 184 */     dbmMgr.update("deleteTb_goodstateByGoodsId", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 197 */     Tb_goodstate tb_goodstate = new Tb_goodstate();
/* 198 */     tb_goodstate.setState_id(map.getString("state_id"));
/* 199 */     tb_goodstate.setGoods_id(map.getString("goods_id"));
/* 200 */     tb_goodstate.setState_name(map.getString("state_name"));
/* 201 */     tb_goodstate.setState_code(map.getString("state_code"));
/* 202 */     tb_goodstate.setStart_date(map.getString("start_date"));
/* 203 */     tb_goodstate.setEnd_date(map.getString("end_date"));
/* 204 */     tb_goodstate.setIn_date(map.getString("in_date"));
/* 205 */     tb_goodstate.setUser_id(map.getString("user_id"));
/* 206 */     tb_goodstate.setRemark(map.getString("remark"));
/*     */ 
/* 208 */     String result_code = "0";
/*     */     try {
/* 210 */       update(dbmMgr, tb_goodstate);
/*     */     } catch (ApplicationException e) {
/* 212 */       e.printStackTrace();
/* 213 */       result_code = "1";
/*     */     }
/* 215 */     map.setString("result_code", result_code);
/* 216 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Tb_goodstate tb_goodstate)
/*     */     throws ApplicationException
/*     */   {
/* 225 */     dbmMgr.update("updateTb_goodstate", tb_goodstate);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 235 */     Tb_goodstate tb_goodstate = (Tb_goodstate)obj;
/* 236 */     Map params = new Hashtable();
/* 237 */     if (start == 0)
/* 238 */       start = 0;
/*     */     else {
/* 240 */       start = (start - 1) * limit;
/*     */     }
/* 242 */     limit = start + limit;
/* 243 */     params.put("start", Integer.valueOf(start));
/* 244 */     params.put("end", Integer.valueOf(limit));
/*     */ 
/* 246 */     return this.queryList.getList("getListByTb_goodstatePage", params);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 257 */     Tb_goodstate tb_goodstate = (Tb_goodstate)obj;
/* 258 */     Map params = new Hashtable();
/*     */ 
/* 260 */     return 0;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 270 */     return this.queryList.getList("getTb_goodstateByPk", pk);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.tb_goodstate.Tb_goodstateInfo
 * JD-Core Version:    0.6.0
 */